﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using AMatysiak.Methods;

namespace AMatysiakTest.Methods.TypeExtensions
{
    [TestClass]
    public class ToDoubleTest
    {
        [TestMethod]
        public void parseNormalDouble()
        {
            string s = "2.00";
            double d = s.ToDouble();

            Assert.AreEqual(2.00, d);
        }

        [TestMethod]
        public void parseInt()
        {
            string s = "2";
            double d = s.ToDouble();

            Assert.AreEqual(2.00, d);
        }

        [TestMethod]
        public void parseCurrency()
        {
            string s = "2,50 zł";
            double d = s.ToDouble();

            Assert.AreEqual(2.50, d);
        }

        [TestMethod]
        public void parseEmpty()
        {
            string s = "";
            double d = s.ToDouble();

            Assert.AreEqual(0, d);
        }
    }
}
